
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Unit Tests &#8212; Texas A&amp;M Oil spill / Outfall Calculator 2.1.0 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Glossary" href="glossary.html" />
    <link rel="prev" title="blowout.create_ambient_profile" href="autodoc/blowout/blowout.create_ambient_profile.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="unit-tests">
<h1>Unit Tests<a class="headerlink" href="#unit-tests" title="Permalink to this headline">¶</a></h1>
<dl class="field-list simple">
<dt class="field-odd">Release</dt>
<dd class="field-odd"><p>2.1</p>
</dd>
<dt class="field-even">Date</dt>
<dd class="field-even"><p>Jun 05, 2020</p>
</dd>
</dl>
<p>This package is distributed with a set of unit tests to check most of the
functionality of the package.  To run the tests, install
<a class="reference external" href="http://pytest.org/latest/">pytest</a> into your Python distribution.  Then,
from a directory outside of the source files of the distribution, execute at
the command prompt:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">py</span><span class="o">.</span><span class="n">test</span> <span class="o">-</span><span class="n">v</span> <span class="o">--</span><span class="n">pyargs</span> <span class="n">tamoc</span>
</pre></div>
</div>
<p>If any of the tests fail, first delete the <code class="docutils literal notranslate"><span class="pre">__pycache__</span></code> directory from the
hard drive and re-run the test. If you are getting write permission errors,
try executing the above command using <cite>sudo</cite>. If that does not solve the
problem, please read the test-specific guidelines below for further potential
bug fixes.</p>
<div class="section" id="module-test_ambient">
<span id="test-ambient-py"></span><h2>test_ambient.py<a class="headerlink" href="#module-test_ambient" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>ambient</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of all of the functions, classes and methods in the <cite>ambient</cite>
module. These tests rely on data stored in the <code class="docutils literal notranslate"><span class="pre">./data</span></code> folder and will
write data to and read data from the <code class="docutils literal notranslate"><span class="pre">./test/output</span></code> folder.</p>
</div>
<div class="section" id="module-test_dbm_objects">
<span id="test-dbm-objects-py"></span><h2>test_dbm_objects.py<a class="headerlink" href="#module-test_dbm_objects" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>dbm</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of instantiation of the class objects defined in <code class="docutils literal notranslate"><span class="pre">dbm.py</span></code>.</p>
<div class="section" id="notes">
<h3>Notes<a class="headerlink" href="#notes" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed function–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_dbm">
<span id="test-dbm-py"></span><h2>test_dbm.py<a class="headerlink" href="#module-test_dbm" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>dbm</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of the functions defined in <code class="docutils literal notranslate"><span class="pre">dbm_f</span></code>.</p>
<p><code class="docutils literal notranslate"><span class="pre">dbm_f</span></code> is a library created by <code class="docutils literal notranslate"><span class="pre">f2py</span></code> from the source code:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dbm_eos</span><span class="o">.</span><span class="n">f95</span>
<span class="n">dbm_phys</span><span class="o">.</span><span class="n">f95</span>
<span class="n">math_funcs</span><span class="o">.</span><span class="n">f95</span>
</pre></div>
</div>
<p>It can be compiled using:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">f2py</span> <span class="o">-</span><span class="n">c</span> <span class="o">-</span><span class="n">m</span> <span class="n">dbm_f</span> <span class="n">dbm_eos</span><span class="o">.</span><span class="n">f95</span> <span class="n">dbm_phys</span><span class="o">.</span><span class="n">f95</span> <span class="n">math_funcs</span><span class="o">.</span><span class="n">f95</span>
</pre></div>
</div>
<p>This module tests direct calling of the <code class="docutils literal notranslate"><span class="pre">dbm_f</span></code> functions from Python as 
well as calls to the functions implemented in <cite>dbm</cite>.</p>
<div class="section" id="id1">
<h3>Notes<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed function–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_sintef">
<span id="test-sintef-py"></span><h2>test_sintef.py<a class="headerlink" href="#module-test_sintef" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>sintef</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of all of the functions in the <cite>sintef</cite> module.  Since this
is a simple module, the unit tests are stand-alone and do not require 
external data source or disk access.</p>
<div class="section" id="id2">
<h3>Notes<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed functions–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_psm">
<span id="test-psm-py"></span><h2>test_psm.py<a class="headerlink" href="#module-test_psm" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>particle_size_model</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of the classes, methods and functions defined in the
<cite>particle_size_models</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code>.  These tests check the behavior
of the class objects, the results of simulations, and the related object
methods.</p>
<p>The ambient data used here to compute oil properties at <cite>in situ</cite> conditions
are from the <cite>ctd_BM54.cnv</cite> dataset, stored as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">test</span><span class="o">/</span><span class="n">output</span><span class="o">/</span><span class="n">test_BM54</span><span class="o">.</span><span class="n">nc</span>
</pre></div>
</div>
<p>This netCDF file is written by the <cite>test_ambient.test_from_ctd</cite> function,
which is run in the following as needed to ensure the dataset is available.</p>
<p>Since the <cite>particle_size_models</cite> module relies on the functions in the
<cite>psf</cite> module to compute results, this set of tests checks the performance
of both modules.</p>
<div class="section" id="id3">
<h3>Notes<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed function–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_params">
<span id="test-params-py"></span><h2>test_params.py<a class="headerlink" href="#module-test_params" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>params</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of all of the classes and methods in the <cite>params</cite> module.
This module uses the <cite>ambient</cite> module to control ambient data and the <cite>dbm</cite>
module to predict particle behavior. These tests check the behavior of the
<cite>params.Scales</cite> object and the results of its methods.</p>
<p>The ambient data used here are from the <cite>ctd_BM54.cnv</cite> dataset, stored as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">test</span><span class="o">/</span><span class="n">output</span><span class="o">/</span><span class="n">test_BM54</span><span class="o">.</span><span class="n">nc</span>
</pre></div>
</div>
<p>This netCDF file is written by the <cite>test_ambient.test_from_ctd</cite> function,
which is run in the following test script as needed to ensure the dataset is
available.</p>
<div class="section" id="id4">
<h3>Notes<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed functions–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_sbm">
<span id="test-sbm-py"></span><h2>test_sbm.py<a class="headerlink" href="#module-test_sbm" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>single_bubble_model</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of the objects, methods and functions defined in the
<cite>single_bubble_model</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code>.  This module uses the <cite>ambient</cite>
module to control ambient data and the <cite>dbm</cite> module to predict particle
behavior.  These tests check the behavior of the object, the results of
the simulations, and the read/write algorithms.</p>
<p>The ambient data used here are from the <cite>ctd_BM54.cnv</cite> dataset, stored as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">test</span><span class="o">/</span><span class="n">output</span><span class="o">/</span><span class="n">test_BM54</span><span class="o">.</span><span class="n">nc</span>
</pre></div>
</div>
<p>This netCDF file is written by the <cite>test_ambient.test_from_ctd</cite> function,
which is run in the following as needed to ensure the dataset is available.</p>
<div class="section" id="id5">
<h3>Notes<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed function–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_spm">
<span id="test-spm-py"></span><h2>test_spm.py<a class="headerlink" href="#module-test_spm" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>stratified_plume_model</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of the objects, methods and functions defined in the
<cite>stratified_plume_model</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code>.  This module uses the <cite>ambient</cite>
module to control ambient data and the <cite>dbm</cite> module to predict particle
behavior.  These tests check the behavior of the object, the results of
the simulations, and the read/write algorithms.</p>
<p>The ambient data used here are from the <cite>ctd_BM54.cnv</cite> dataset, stored as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">test</span><span class="o">/</span><span class="n">output</span><span class="o">/</span><span class="n">test_BM54</span><span class="o">.</span><span class="n">nc</span>
</pre></div>
</div>
<p>This netCDF file is written by the <cite>test_ambient.test_from_ctd</cite> function,
which is run in the following as needed to ensure the dataset is available.</p>
<div class="section" id="id6">
<h3>Notes<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed function–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_bpm">
<span id="test-bpm-py"></span><h2>test_bpm.py<a class="headerlink" href="#module-test_bpm" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>bent_plume_model</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of the classes, methods and functions defined in the
<cite>bent_plume_model</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code>. These tests check the behavior of the
object, the results of the simulations, and the read/write algorithms.</p>
<p>The ambient data used here are from the <cite>ctd_BM54.cnv</cite> dataset, stored as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">test</span><span class="o">/</span><span class="n">output</span><span class="o">/</span><span class="n">test_BM54</span><span class="o">.</span><span class="n">nc</span>
</pre></div>
</div>
<p>This netCDF file is written by the <cite>test_ambient.test_from_ctd</cite> function,
which is run in the following as needed to ensure the dataset is available.</p>
<div class="section" id="id7">
<h3>Notes<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed function–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
<div class="section" id="module-test_blowout">
<span id="test-blowout-py"></span><h2>test_blowout.py<a class="headerlink" href="#module-test_blowout" title="Permalink to this headline">¶</a></h2>
<p>Unit tests for the <cite>blowout</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code></p>
<p>Provides testing of the class definition, methods, and functions in the
<cite>blowout</cite> module of <code class="docutils literal notranslate"><span class="pre">TAMOC</span></code>.  These tests check the behavior of the class
object, the results of simulations, and the related object methods.</p>
<p>The ambient data used here are from the <cite>ctd_BM54.cnv</cite> dataset, stored as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">./</span><span class="n">test</span><span class="o">/</span><span class="n">output</span><span class="o">/</span><span class="n">test_BM54</span><span class="o">.</span><span class="n">nc</span>
</pre></div>
</div>
<p>This netCDF file is written by the <cite>test_ambient.test_from_ctd</cite> function,
which is run in the following as needed to ensure the dataset is available.</p>
<div class="section" id="id8">
<h3>Notes<a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<p>All of the tests defined herein check the general behavior of each of the
programmed function–this is not a comparison against measured data. The
results of the hand calculations entered below as sample solutions have been
ground-truthed for their reasonableness. However, passing these tests only
means the programs and their interfaces are working as expected, not that they
have been validated against measurements.</p>
</div>
</div>
</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">Texas A&M Oil spill / Outfall Calculator</a></h1>








<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="user_manual.html">TAMOC User Manual</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Unit Tests</a></li>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="bugs.html">Reporting Bugs</a></li>
<li class="toctree-l1"><a class="reference internal" href="readme.html">Read Me File</a></li>
<li class="toctree-l1"><a class="reference internal" href="release.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
      <li>Previous: <a href="autodoc/blowout/blowout.create_ambient_profile.html" title="previous chapter">blowout.create_ambient_profile</a></li>
      <li>Next: <a href="glossary.html" title="next chapter">Glossary</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2020, Scott A. Socolofsky.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 2.4.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/unit_tests.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>